package com.rightsidetech.system.dtos.request.agent;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @Author: yhr
 * @Date: 2021-11-01 17:13
 */
@Data
public class SysAgentAdminInfoAddReq implements Serializable {
    @ApiModelProperty(value = "帐号", required = true)
    @NotBlank(message = "帐号不能为空")
    @Pattern(regexp = "^$|^[a-zA-Z0-9_]{1,12}$",message = "登录账号由字母数字下划线任意组成长度最大12位")
    private String loginName;
    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^$|^[a-zA-Z0-9_!@#$%^&*?.,:;]{6,20}$", message = "密码由字母数字特殊字符任意组成长度在6-20之间")
    private String password;
    @ApiModelProperty(value = "姓名", required = true)
    @NotBlank(message = "姓名不能为空")
    @Length(max = 10,message = "姓名长度不合法")
    @Pattern(regexp = "^$|[\\u4e00-\\u9fa5]+", message = "姓名请输入中文")
    private String userName;
    @ApiModelProperty(value = "手机号", required = true)
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[0-9]{10}$",message = "请输入正确的手机号")
    private String mobileNo;
    @ApiModelProperty(value = "角色", required = true)
    @NotNull(message = "角色不能为空")
    @Min(value = 1,message = "角色id不合法")
    private Long roleId;
}
